//
//  IphoneListCellTableViewCell.m
//  PaiQuan
//
//  Created by 范利峰 on 16/7/10.
//  Copyright © 2016年 huigu. All rights reserved.
//

#import "IphoneListCellTableViewCell.h"
@interface IphoneListCellTableViewCell()

//@property(nonatomic,strong)UIView *lineView;

@end
@implementation IphoneListCellTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        [self setupSubviews];
        [self setConstraints];
    }
    return self;
}
-(void)setupSubviews{
    [self.contentView addSubview:self.imgView];
    [self.contentView addSubview:self.titleLabel];
    
//    [self.contentView addSubview:self.lineView];
    [self.contentView addSubview:self.inviteBtn];
}
-(void)setConstraints{
    [self.imgView makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView.left).offset(RATIO(26));
        make.width.height.equalTo(RATIO(34));
        make.top.equalTo(self.contentView.top).offset(RATIO(20));
    }];
    
    [self.titleLabel makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.equalTo(self.contentView).offset(RATIO(124));
        make.centerY.equalTo(self.imgView);
    }];
//    [self.lineView makeConstraints:^(MASConstraintMaker *make) {
//        make.width.bottom.left.equalTo(self.contentView);
//        make.height.equalTo(RATIO(6));
//        
//    }];
    [self.inviteBtn makeConstraints:^(MASConstraintMaker *make) {
        make.width.equalTo(RATIO(96));
        make.height.equalTo(RATIO(48));
        make.right.equalTo(self.contentView.right).offset(-RATIO(30));
        make.centerY.equalTo(self.contentView.centerY);
    }];
    
    
    
    
}

#pragma mark --懒加载
-(UIImageView*)imgView{
    if (!_imgView) {
        _imgView = [[UIImageView alloc] init];
        
    }
    return _imgView;
    
    
    
}
//-(UIView*)lineView{
//    if (!_lineView) {
//        _lineView = [[UIView alloc] init];
//        _lineView.backgroundColor = PQ_COLOR_DarkGray;
//    }
//    return _lineView;
//    
//    
//    
//    
//}
-(UILabel*)titleLabel{
    if (!_titleLabel) {
        _titleLabel = [[UILabel alloc] init];
    }
    return _titleLabel;
    
    
    
}
-(UIButton*)inviteBtn{
    if (!_inviteBtn) {
        _inviteBtn = [[UIButton alloc] init];
        _inviteBtn.layer.masksToBounds = YES;
        _inviteBtn.layer.cornerRadius = RATIO(8);
        [_inviteBtn setTitle:@"邀请" forState:UIControlStateNormal];
        [_inviteBtn setTitleColor:PQ_COLOR_YELLOW forState:UIControlStateNormal];
        [_inviteBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateSelected];
        _inviteBtn.backgroundColor = PQ_COLOR_SimpleGary;
        _inviteBtn.titleLabel.font =FONT(14);
        
        
    }
    return _inviteBtn;
    
    
    
}



@end


